import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Main from "../views/Main.vue";
import Test from "../views/Test.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: 'home'
  },
  {
    path: "/home",
    name: "Home",
    component: Home,
    // redirect: '/home/main',
    children: [
      {
        path: 'main',
        name: 'main',
        component: Main
      },
      {
        path: 'test',
        name: 'test',
        component: Test
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
